package com.eight.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 菜单权限表
 * @author 郭坤
 * @since 2023-02-24
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="sysMenu", description="菜单权限实体类")
@TableName(value = "sys_menu")
public class SysMenu implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "菜单ID")
    @TableId(value = "id", type = IdType.AUTO)
    @TableField(value = "id")
    private Integer id;

    @ApiModelProperty(value = "菜单名称")
    @TableField(value = "menu_name")
    private String menuName;

    @ApiModelProperty(value = "父菜单ID")
    @TableField(value = "parent_id")
    private Integer parentId;

    @ApiModelProperty(value = "显示顺序")
    @TableField(value = "order_num")
    private Integer orderNum;

    @ApiModelProperty(value = "请求地址")
    @TableField(value = "url")
    private String url;

    @ApiModelProperty(value = "菜单类型（M目录 C菜单 F按钮）")
    @TableField(value = "menu_type")
    private String menuType;

    @ApiModelProperty(value = "菜单状态（0显示 1隐藏）")
    @TableField(value = "visible")
    private String visible;

    @ApiModelProperty(value = "权限标识")
    @TableField(value = "perms")
    private String perms;

    @ApiModelProperty(value = "菜单图标")
    @TableField(value = "icon")
    private String icon;

    @ApiModelProperty(value = "创建者")
    @TableField(value = "create_by")
    private String createBy;

    @ApiModelProperty(value = "创建时间")
    @TableField(value = "create_time")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "更新者")
    @TableField(value = "update_by")
    private String updateBy;

    @ApiModelProperty(value = "更新时间")
    @TableField(value = "update_time")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime updateTime;

    @ApiModelProperty(value = "备注")
    @TableField(value = "remark")
    private String remark;

    @TableField(exist = false)
    private List<SysMenu> childMenu;


}
